package com.hunter.api.bean;

import java.io.Serializable;

import com.alibaba.fastjson.JSONObject;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class EntityBean implements Serializable {
    private static final long serialVersionUID = -5408345866319299888L;

    //基础字段
    /**
     * 1.主键id
     * 2.显示顺序 ordinal
     * 3.是否启用 enabled
     * 4.创建时间 created_time
     * 5.创建人 created_by
     * 6.更新时间 updated_time
     * 7.更新人 updated_by
     * 8.删除时间 deleted_time
     * 9.删除人 deleted_by
     * 10.是否删除 is_deleted
     */
    private Long id;
    private Integer ordinal;
    private Integer enabled;
    public String created_time;
    private String created_by;
    private String updated_time;
    private String updated_by;
    private String deleted_time;
    private String deleted_by;
    private Integer is_deleted;

    //用户名
    private String code;
    //姓名
    private String name;
    //图像url
    private String img_url;
    //说明
    private String note;
    //更新数据的sql
    private String update_json;
    //添加数据的sql
    private String insert_json;
    //详情sql
    private String info_json;
    //列表sql
    private String lv_json;
    //删除sql
    private String delete_json;
    //enable/disable sql
    private  String enable_json;
    //添加数据 唯一验证json
    private  String unique_insert_json;
    //修改数据  唯一验证json
    private String unique_update_json;
    //子表相关配置
    private String children_json;
    //作为子表时，父表的oid
    private Long parent_id;
    //entity类型：0-实体表；1-虚拟表
    private Integer entity_type;
    //datasource id
    private Long ds_id;
    //版本
    private Integer version;
    //对应数据表名
    private String table_name;

    //数据
    private JSONObject data;
}
